import { OcrTaskEntity } from '../entities/ocr-task.entity'

export enum OcrTaskType {
  TENCENT = 1,
  ALIYUN = 2,
}

export enum OcrTaskStatus {
  NOT_STARTED = 0,
  PROCESSING = 1,
  COMPLETED = 2,
  FAILED = 3,
}

export interface OcrTaskResult {
  id: number
  taskId: string
  url: string
  status: OcrTaskStatus
}

export interface TencentOcrResponse {
  RequestId: string
  TextDetections: {
    DetectedText: string
    Confidence: number
    Polygon: {
      X: number
      Y: number
    }[]
    AdvancedInfo: string
  }[]
  Language: string
  Angel: number
  PdfPageSize?: number
}

export interface OcrTaskPaginationResult {
  items: OcrTaskEntity[]
  total: number
  page: number
  pageSize: number
}
